//auto gen by paipai.java.augogen ver 154
//author floatman
#ifndef _COMPANYAO_COMPANY_H_
#define _COMPANYAO_COMPANY_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_companyao.h"

#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include <vector>
#include <set>
#include <map>
#include "erp/company/po/companyinfopo_company.h"
#include "erp/company/po/companyfilterpo_company.h"

HEADER_SELF_DEFINE_START
/**
*  请在这里增加自定义包含的头文件，否则无法合并代码
**/
HEADER_SELF_DEFINE_END

namespace erp
{
namespace company
{
namespace ao
{

#define COMPANYAO_SERVICE_VERSION "ERP_COMPANY_AO___COMPANYAO__SERVICE_VERSION__1.0 2013-10-24 15:49:34"
const std::string COMPANYAO_SERVICE_NOUSE = COMPANYAO_SERVICE_VERSION;

SERVICE class CCompanyAo : public ICompanyAo{
public:
		CCompanyAo(enum DeployMethod method = DEPLOY_STANDALONE);
		~CCompanyAo();
		 void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
	 /**
	 *
	 *   添加/修改用户企业信息；传入用户企业SysNo不为0时则进行修改，反之则进行添加；
	 *
	 */
	EXPORT(0xc0670001) uint32_t AddAndUpdateCompanyInfo(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::company::po::CCompanyInfoPo& oCompanyInfoPo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   删除用户企业（逻辑）
	 *
	 */
	EXPORT(0xc0670002) uint32_t DeleteCompanyInfo(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 uint64_t ddwCompanySysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据用户企业ID批量获取用户企业信息
	 *
	 */
	EXPORT(0xc0670003) uint32_t GetCompanyInfoByIds(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setCompanySysNo,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::map<uint64_t,erp::company::po::CCompanyInfoPo> & mapCompanyInfoPo,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据过滤条件查询用户企业列表信息
	 *
	 */
	EXPORT(0xc0670004) uint32_t GetCompanyInfoByFilter(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::company::po::CCompanyFilterPo& oFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::company::po::CCompanyInfoPo> & vecCompanyInfoPo,
		 std::string& strOutReserve
		);

SECTION_SELF_DEFINE_START
/**
* 请在这里增加自定义的成员变量和函数，否则无法合并代码
**/

private:
	uint32_t CheckCommPara(
				const CCntlInfo& rCntlInfo,
				const std::string& strMachineKey,
				const std::string& strSource,
				uint32_t dwSceneId);

private:
	erp::company::dao::CCompanyDaoStub4App m_cCompanyDaoStub4App;

SECTION_SELF_DEFINE_END

private:
	enum DeployMethod m_method;
};

}
}
}

#endif /* _COMPANYAO_COMPANY_H_ */
